﻿@page
@model AdminUI.Pages.BaseData.UserAddModel
@{
    var F = Html.F();
}

@section body {
    <f:Form ID="Form1" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="15" IsViewPort="true">
        <Rows>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:TextBox ID="TrueName" Required="false" Label="会员姓名" EmptyText="请输入会员姓名"></f:TextBox>
                    <f:TextBox ID="Mobile" Required="false" Label="会员手机" EmptyText="请输入会员手机号（用于登录）"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:DropDownList ID="UserType" Label="会员类型" SelectedValue="C">
                        <f:ListItem Text="A级会员" Value="A" />
                        <f:ListItem Text="B级会员" Value="B" />
                        <f:ListItem Text="C级会员" Value="C" />
                    </f:DropDownList>
                    <f:DropDownList ID="Role" Label="管理角色" SelectedValue="0">
                        <f:ListItem Text="普通会员" Value="0" />
                        <f:ListItem Text="财务人员" Value="1" />
                        <f:ListItem Text="仓库管理" Value="2" />
                        <f:ListItem Text="平台管理" Value="9" />
                    </f:DropDownList>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:RadioButtonList ID="Sex" Label="性别" SelectedValue="">
                        <f:RadioItem Text="男" Value="男" />
                        <f:RadioItem Text="女" Value="女" />
                    </f:RadioButtonList>
                    <f:TriggerBox ID="RecoName" Label="选择推荐人" Readonly="false" TriggerIcon="Search" Text=""
                                  OnClientTriggerClick="onSelectUser();" EmptyText="" EnableClickAction="false" >
                    </f:TriggerBox>
                    <f:HiddenField ID="RecoID" Label="推荐人ID" Text="0"></f:HiddenField>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="100%">
                <Items>
                    <f:TextBox ID="CustomerName" Required="false" Label="客户名称" EmptyText="请输入客户名称：门店名称或公司名称"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:CheckBox ID="IsAgent" Label="代理设置" Text="开通代理" Checked="false"></f:CheckBox>
                    <f:TriggerBox ID="CityName" Label="代理城市" Readonly="false" TriggerIcon="Search" Text=""
                                  OnClientTriggerClick="onSelectCity();" EmptyText="请选择代理城市" EnableClickAction="false">
                    </f:TriggerBox>
                    <f:HiddenField ID="AgentAreaID" Label="代理城市ID" Text="0"></f:HiddenField>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:TriggerBox ID="CountyName" Label="所在区县" Readonly="false" TriggerIcon="Search" Text=""
                                  OnClientTriggerClick="onSelectArea();" EmptyText="请选择所属区县" EnableClickAction="false">
                    </f:TriggerBox>
                    <f:HiddenField ID="CountyID" Label="所在区县ID" Text="0"></f:HiddenField>
                    <f:TextBox ID="ReceiverName" Required="false" Label="收货人姓名" EmptyText="请输入收货人姓名"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:TextBox ID="ReceiverPhone" Required="false" Label="收货人电话" EmptyText="请输入收货人电话"></f:TextBox>
                    <f:TextBox ID="ReceiveAddress" Required="false" Label="收货地址" EmptyText="请输入收货地址"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="50% 50%">
                <Items>
                    <f:TextBox ID="ClearingBank" Required="false" Label="结算银行" EmptyText="请输入结算银行"></f:TextBox>
                    <f:TextBox ID="BankAccountName" Required="false" Label="开户名称" EmptyText="请输入开户人姓名或开户单位名称"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="100%">
                <Items>
                    <f:TextBox ID="BankCardNo" Required="false" Label="银行卡号" EmptyText="请输入银行卡号"></f:TextBox>
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="100%">
                <Items>
                    <f:TextArea ID="Memo" EmptyText="请输入备注" Label="备注" AutoGrowHeight="true" AutoGrowHeightMin="200" AutoGrowHeightMax="400"></f:TextArea>
                </Items>
            </f:FormRow>
        </Rows>
        <Toolbars>
            <f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Left">
                <Items>
                    <f:Button ID="btnClose" Text="关闭" Icon="Cross" OnClientClick="F.activeWindow.hide();"></f:Button>
                    <f:Button ID="btnReset" Text="重置" Icon="ArrowUndo" OnClientClick="F.ui.Form1.reset();"></f:Button>
                    <f:Button ID="btnSubmit" Text="保存" Icon="SystemSave" OnClick="@Url.Handler("btnSubmit_Click")" _ValidateForms="Form1" OnClickFields="Form1"></f:Button>
                </Items>
            </f:Toolbar>
        </Toolbars>
    </f:Form>

    <f:Window ID="Window1" IsModal="true" Hidden="true" Target="Top" EnableResize="true" EnableMaximize="true" EnableIFrame="true" Width="400" Height="500">
        <Listeners>
            <f:Listener Event="close" Handler="onWindowClose('refresh');"></f:Listener>
        </Listeners>
    </f:Window>

}

@section script {
    <script>
        function onSelectUser(event) {
            var path = "/Dialog/SelectUser";
            F.ui.Window1.show(path, '选择推荐人', 700, 500);
        }

        function updateUserSelectValue(id, text) {
            F.ui.RecoName.setText(id + '-' + text);
            F.ui.RecoID.setValue(id);
        }

        function onSelectArea(event) {
            var path = "/Dialog/SelectArea?t=3";
            F.ui.Window1.show(path, '选择上级菜单（双击选择）', 400, 500);
        }

        function updateTreeSelectValue(treeNode) {
            F.ui.CountyName.setText(treeNode.id + '-' + treeNode.text);
            F.ui.CountyID.setValue(treeNode.id);

            //F.doPostBack('@Url.Handler("County_Change")', {
            //    'countyID': F.ui.CountyID.getValue()
            //});
        }
        function onSelectCity(event) {
            var path = "/Dialog/SelectCity";
            F.ui.Window1.show(path, '选择上级菜单（双击选择）', 400, 500);
        }

        function updateCitySelectValue(treeNode) {
            F.ui.CityName.setText(treeNode.id + '-' + treeNode.text);
            F.ui.AgentAreaID.setValue(treeNode.id);

            //F.doPostBack('@Url.Handler("County_Change")', {
            //    'countyID': F.ui.CountyID.getValue()
            //});
        }
    </script>
}
